SOS_CONTAINER_SET

Section: SOS C++ LIBRARY (3S)
Updated: 28/10/1991
Index Return to Main Contents
man2html: unable to open or read file /usr/lib/ms/ms.acc
 

NAME

sos_Container_set - predefined class sos_Container_set  

SYNOPSIS

#include "<SOS>/include/knl_sos.h"

class sos_Container_set
{
public:
   static sos_Open_result    open (sos_Container_set rd,
                                   sos_Container_set wr, 
                                   sos_Sync_mode);

          sos_Open_result    open (sos_Access_mode,
                                   sos_Sync_mode) const;
          void               close() const;
          void               commit() const;
          void               reset() const;

   static sos_Container_set& open_containers(sos_Container_status);
          sos_Container_set& operator+= (sos_Container);
          unsigned           card() const;
}

cnt_iterate(sos_Container_set cs, sos_Container c)
{ ...
} cnt_iterate_end(cs, c)
 

DESCRIPTION

The class sos_Container_set provides operations for synchronisation of reading and modifying accesses to container sets, and for starting and finishing transactions on container sets.

open (rd, wr, sm)
atomically opens the containers of the container set rd for reading and the containers of the container set wr for writing. A container can be opened only by one process for writing or by several processes for reading, but never by more than one for writing or for both reading and writing.
For a description of the result value, see open (am, sm) below.
open (am, sm)
opens the containers of the container set according to the parameter am of type sos_Access_mode. If am is READING, the container is opened for reading, if am is WRITING, the container is opened for writing. A container can be opened only by one process for writing or by several processes for reading, but never by more than one for writing or for both reading and writing.
If all containers of the set can be opened according to this synchronisation strategy, OPENED is returned. If not, the effect is determined by the parameter sm of type sos_Sync_mode: WAITING will cause the process to block until all containers of the set become available, and with TESTING, LOCKED is returned immediately indicating that no container was not opened. In any case, UNACCESSIBLE is returned if one of the containers does not exist or could not be opened due to lacking privileges or other reasons.
A two-phase locking strategy is employed for avoiding deadlocks between processes trying to open non-disjunct container sets.
close ()
closes the containers of the set cs and makes them accessible to other processes according to the synchronisation strategy. A close on a container set opened for writing implies a commit on that set.
commit ()
makes the changes to all containers of the set since the last commit (or open) definitive (i.e. writes them to secondary storage if not yet written). commit is only allowed on a container set opened for writing.
reset ()
makes the changes to all containers of the set since the last commit (or open) undone. reset is only allowed on a container set opened for writing.

The remaining operations operate on the set data structure:

open_containers (s)
returns a container set with all containers which are currently opened by the running process and have sos_Container_status s.
operator+= (c)
Add container c to the set of containers cs. Initially a sos_Container_set is empty.
card ()
returns the number of containers in the container set.
cnt_iterate[_end] (cs, c)
analogously to agg_iterate(c, e) for sos_Aggregate, the macro iterates over the sos_Container_set cs and sets c to the current sos_Container each time before entering the loop body. cs must not be modified (insertion/deletion of a container) during the iteration.
The actual expression for cs should be a variable since it might be evaluated more than once. The actual expression for c must be a variable, optionally preceded by the type sos_Container, in which case a variable of this type will be declared local to the loop body.

All containers are located in the directory given by the environment variable SOSCONTAINER.  

FILES

$SOSCONTAINER
directory with all containers

<SOS>/src/psm/psm.h
include file for container set class definition

<SOS>/src/psm/psm.c
implementation of the container set class
 

BUGS

Crash recovery works for single containers, not for container sets, e.g. a crash during a commit on a container set may result in some containers being committed and some being resetted.  

SEE_ALSO

sos_Container(3), sos_Aggregate(3)  

AUTHOR

Emil Sekerinski, Walter Zimmer


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILES
BUGS
SEE_ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 00:37:57 GMT, March 30, 2022